#include <glade/glade.h>
#include <gtk/gtk.h>
#include <libnotify/notification.h>
#include <libnotify/notify.h>

NotifyNotification *notify1;
int main(int argc, char** argv)
{
	GladeXML *gxml;
	GtkWidget *hwin;
	gtk_init(&argc,&argv);
	gxml=glade_xml_new("glade1.glade",NULL,NULL);
	hwin=glade_xml_get_widget(gxml,"hwin");
	glade_xml_signal_autoconnect(gxml);
	//------------------------------------------------
	notify_init("HelloNotify");
	notify1=notify_notification_new("this is summary","this is body","battery-caution",0);
	//"battery-caution" refrer to gnome theme
	
	//------------------------------------------------
	gtk_widget_show_all(hwin);
	gtk_main();
	notify_uninit ();
	//g_signal_connect(G_OBJECT(button1),"clicked",G_CALLBACK(cb_button1),"hahahahahaha的方式都");
	//g_signal_connect(G_OBJECT(hwin), "destroy", G_CALLBACK(gtk_main_quit), NULL);
	return 0;
}
void cb_button1()
{
	notify_notification_show (notify1,&gerror1);

}
void cb_button2()
{
	char warning1[30];
	static int count=0;
	count++;
	sprintf(warning1,"update %d count(s)",count);
	notify_notification_update(notify1,"update",warning1,"battery-caution");
	notify_notification_show (notify1,0);
}
void DoExit()
{
	notify_uninit();
	gtk_main_quit();
}
